package com.zds.e_exception;

import com.zds.y_entity.ResultEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;

/**
 * reful-api日志处理
 * @className:GalobalException
 * @date: 2025/1/16 下午2:32
 * @description:
 */
@Slf4j
//@RestControllerAdvice
public class GalobalExceptionHandler {
//    @ExceptionHandler(value = {RuntimeException.class})
    protected ResultEntity handleException(RuntimeException e) {
        String msg = "异常信息"+e.getMessage();
        log.error(e.getMessage());
        return new ResultEntity(msg,ResultEntity.CODE_ERROR);
    }
}
